package com.neusoft.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import com.neusoft.po.VirtualWalletTransaction;

@Mapper
public interface VirtualWalletTransactionMapper {
	
	//创建交易流水
	@Insert("insert into virtualWalletTransaction(time,amount,transactionType,inWalletId,outWalletId) values(#{time},#{amount},#{transactionType},#{inWalletId},#{outWalletId})")
	@Options(useGeneratedKeys = true, keyProperty = "transactionId", keyColumn = "transactionId")
	public int saveTransaction(VirtualWalletTransaction transaction);
	
	//查询交易流水
	@Select("select* from virtualWalletTransaction where inWalletId=#{walletId} or outWalletId=#{walletId} order by time desc")
	public List<VirtualWalletTransaction> getTransaction(Integer walletId);
	
}
